Skip to content

Conversation

@garyb
Copy link
Member

@garyb garyb commented Sep 30, 2016

Just throwing this out there - the Extend instance is a little bonkers, so we can just close this if it seems nonsensical.

I feel like the Extend instance really should operate on each subset of the thing, so if it was a 1 :| [2, 3, 4] it would call f on 1 :| [2, 3, 4], 2 :| [3, 4], 3 :| [4], 4 :| [], but unless we invented some kind of Unconsable class I don't think there's a way of expressing that. Given that, extend operates on every element with an empty tail instead ¯_(ツ)_/¯.

edit: I went with Plus as the constraint since elsewhere we prefer Alternative over Monoid classes.

@garyb garyb closed this Oct 9, 2016
@garyb garyb deleted the comonad branch October 9, 2016 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant